<?php
/**
 * exit
 */
X::import('Application.Modles.Command');

class CExit extends Command {
	public function run(){
		if ( XUser::STATUS_OFFLINE  == X::app()->user->status ){
			$this->result->errno = XErrorCode::USER_OFFLINE ;
			$this->result->error = 'User offline';
			return;	
		}
		else if ( X::app()->session->has('CurrentProject')) {
			X::app()->session->delete('CurrentProject');
		}
		else {
			X::app()->session->clear();
		}
		
		return $this;
	}
}
?>